<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/


get_config_keytable("config_db");

empty($do) && $do = 'list';
//初使化数据库
$dbhost = DB_HOST;		// 数据库服务器
$dbuser = DB_USER;			// 数据库用户名
$dbpwd = DB_PWD;				// 数据库密码
$dbname = DB_NAME;		// 数据库名
include("include/dbbackup.class.php");
include("include/msg.class.php");
$dbbackup = new dbbackup($dbhost, $dbuser, $dbpwd, $dbname);
$msg = new msg();
$tbs = $dbbackup->get_tb();
if ($do == 'list') {

include_once('template/data.php');
} elseif ($do == 'save') {

	$data = $dbbackup->get_backupdata($_POST['choice']);	//获取备份数据
			if($dbbackup->export($data)){							//导入数据
				$bakfn = $msg->get_fn($dbbackup->bakfn);			//取得备份文件名
				//$str = "恭喜您<br>备份成功,备份文件保存在data目录下，" .		//提示信息
				//		"<br>备份文件为<br>".$bakfn;
				//$msg->show_msg($str,'admin.php?ac=data&fileurl=config','import.php');
				goto_page('admin.php?ac=data_import&fileurl=config');
			}
		

} 
?>